#include <LocalFileWindow.h>
#include <QToolBar>
#include <iostream>
#include <ModeControlDialog.h>
#include <EDesignerCore.h>
#include <CommandManager.h>
#include <Commands.h>
#include <QDir>
LocalFileWindow::LocalFileWindow( QWidget *parent /*= 0*/ ) : WindowBase(parent)
{
    setWindowTitle("Local File Window");
    getWindowShowHideAction()->setText("Local File");
    getWindowShowHideAction()->setChecked(true);
    getDockWidget()->setWindowTitle("Local File Window");

    m_treeView = new QTreeView();
    m_fileSystemModel = new QFileSystemModel();

    m_treeView->setModel(m_fileSystemModel);

    setRootPath(QDir::currentPath());
    setCentralWidget(m_treeView);

}

LocalFileWindow::~LocalFileWindow()
{

}

Qt::DockWidgetArea LocalFileWindow::dockWidgetArea()
{
    return Qt::DockWidgetArea::LeftDockWidgetArea;
}



void LocalFileWindow::setUpInitialShowHide()
{
    getWindowShowHideAction()->setChecked(false);

}

void LocalFileWindow::setRootPath(const QString &rootPath)
{
    m_fileSystemModel->setRootPath(rootPath);
    m_treeView->setRootIndex(m_fileSystemModel->index(rootPath));
}


